#ifndef L2_CDTP_SERVER_HPP
#define L2_CDTP_SERVER_HPP

#include "L2CDTP.hpp"

namespace L2CDTP {

class Server {
public:
    class SystemAdapter {
    public:
        virtual bool executeCommand(CommandRequest_t request,CommandResponse_t *response) = 0;
        virtual bool accessData(DataRequest_t request,DataResponse_t *response) = 0;
    };

    typedef unsigned int (*SendCallback)(const char *buffer,unsigned int size);

public:
    explicit Server(SystemAdapter *system_adapter,SendCallback send_callback);
    virtual ~Server();

    void processRequest(char *buffer,unsigned int size);
protected:
    SystemAdapter *system_adapter;
    SendCallback send_callback;
};

}

#endif
